﻿Imports System.Diagnostics.Contracts

Namespace Services.Implementations.XmlRpc
    <Serializable()>
    Friend Class RequestContainer
        Private Sub New()

        End Sub

        Public Property RequestName As String
        Public Property RequestData As IEnumerable(Of Object)

        Public Shared Function Create(name As String, ParamArray args() As Object) As RequestContainer
            Contract.Requires(Of ArgumentException)(Not String.IsNullOrWhiteSpace(name), "Name must be not null1")
            Dim reqCont = New RequestContainer
            reqCont.RequestName = name
            If args IsNot Nothing Then
                reqCont.RequestData = args.ToList()
            End If
            Return reqCont
        End Function

    End Class
End Namespace